<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'', styles:'bootstrap,font-awesome,animate,style,bootstrap-table,layui'}){%>
    <style type="text/css">
        body{padding-top:10px;}
        *{margin:0;padding:0;list-style-type:none;}
        a,img{border:0;}
        .demo h2{font-size:16px;color:#3366cc;height:30px;}
        .demo li{float:left;}
    </style>
    <%}%>
</head>

<body>

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-content" style="padding:15px 20px 0px 20px;">
                <form id="search-form" role="form" class="form-horizontal">
                    <input type="hidden" readonly id="productMember" name="productMember" class="form-control" value="${user.userRealname}">
                    <div class="form-group">
                        <label class="control-label col-sm-1">SKU:</label>
                        <div class="col-sm-2">
                            <input type="text" id="inventorySku" name="inventorySku" class="form-control">
                        </div>
                        <a class="search-btn btn btn-success" style="margin-bottom: 0px;">查询</a>
                    </div>
                </form>
            </div>
            <div id="toolbar" class="btn-group" style="margin-bottom:5px;">
                <button  class="export-btn layui-btn  layui-btn-sm" style="margin-left: -2px">
                    <i class="fa fa-download" aria-hidden="true"></i> 导出当前数据
                </button>
            </div>
            <!-- START 数据表格 -->
            <table id="relatedTable"
                   data-toolbar="#toolbar"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-resizable="true"
                   data-side-pagination="server"
                   data-page-size="15"
                   data-url="/sea/finance/inventory/findByCost.do"
                   class="table table-striped table-hover">
            </table>
            <!-- END 数据表格 -->

            <!-- END 右侧数据 -->
        </div>
    </div>
</div>
<%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,bootstrap-table,dtvalidate,dtvalidate-lang-zh_cn,bootstrap-table-zh-CN,laydate,layer,layui,upload'}){}%>
<script>

    var $relatedTable = $('#relatedTable'),selections=[];
    $(function(){
        //指定允许上传的文件类型
        //START 表格配置
        $relatedTable.bootstrapTable({
            columns: [
                {
                    title: 'SKU',
                    field: 'inventorySku',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '渠道',
                    field: 'inventoryChannelName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '产品名称',
                    field: 'productName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '不含税单价',
                    field: 'erpProduceUnitPrice',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '关税',
                    field: 'createCustomTax',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '运费',
                    field: 'createCustomFreight',
                    align: 'center',
                    valign: 'middle'
                }
            ],
            onLoadSuccess : function(){

            }
        });
    });


    $('.search-btn').on('click',function(){
        $relatedTable.bootstrapTable('refresh', { url:'${ctxPath}/sea/finance/inventory/findByCost.do?'+$('#search-form').serialize() });
    });


    $(".export-btn").click(function () {
        window.location.href='/sea/finance/inventory/exportSkuCost?'+$('#search-form').serialize();
    });
</script>
</body>
</html>
